package com.hc.demo.dto;

/**
 * 前端和后端统一响应结果类型
 */
public class ResultResponse<T> {

    private Integer code; //响应状态编码
    private String desc;  //对应描述信息
    private T data;       //应对后端需要传递数据给前端----前端的查询

    //对应成功时的返回数据
    public static final Integer SUCCESS_CODE=200;
    public static final String SUCCESS_DESC="ops success";

    //空构造方法

    public ResultResponse() {

    }

    //满构造方法

    public ResultResponse(Integer code, String desc, T data) {
        this.code = code;
        this.desc = desc;
        this.data = data;
    }


    //不带数据的构造方法
    public ResultResponse(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
